<?php   
#################################################
#author:jackzheng
#Last upate:2017/10/07
#################################################
header("Content-type: text/html; charset=utf-8");
include $_SERVER['DOCUMENT_ROOT']."/Mapi/library/curl.class.php";

date_default_timezone_set("PRC"); //时区
$http_host =  "http://".$_SERVER['HTTP_HOST'];

$curl = new curl($http_host);
$apiurl="/Mapi/?url=/home/get_news_info";
$parameter=array("get_type"=>'news_list');

$result = $curl->post($apiurl,$parameter,true);
$res_data = $curl->object_array(json_decode($result));



$news_list = $res_data['response']['data'];
$http_host =  "http://".$_SERVER['HTTP_HOST'];
$news_url = $http_host.'/Mapi/public/html/news_detail.php?news_id=';
?>

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta name="format-detection" content="telphone=no, email=no">
    <link rel="stylesheet" href="css/common.css"/>
    <script src="js/resize.js"></script>
    <link rel="stylesheet" href="css/problems.css"/>
    <title>问题</title>
</head>
<body>
    <div class="layout">
        <div class="problems_list">
            <ul class="problems_ul">

            <?php
            foreach($news_list as $k=>$v){
                $v['addtime'] = date('Y-m-d h:i',$v['addtime']);
                echo '<li class="problems_li">
                <a href="'.$news_url.$v['id'].'"><span class="problem_title">'.$v['title'].'</span>
               <span class="arrow_icon">></span></a>
                </li>';
            }?>  

              
            </ul>
         
        </div>
       
    </div>

  
    
    
</body>
</html>

